<?php
/*
 * Author :pandiam & basanas
 */
require_once ('include/css_head.php');
require_once ('include/functions.php');
require_once ('include/header.php');

if (isset($_SESSION['uid']) && (($_SESSION['uid']) != -1))
{
    UI_registerError('msg_info', "You are already logged-in, <a href=\"logout.php\">logout</a> first.");
    header("location: index.php");
    exit(0);
}
?>

<script type='text/javascript' src="js/checkRegisterLib.js"></script>

    <div id="registrationDiv">
        <div id="msg-box"></div>
		<form name="register" action="registerDo.php" method="post">
            <fieldset id="registerField">
                <legend>
                    <font size="4"> Registration </font>
                </legend>
            <span style="text-align: center">The fields with the <font color="red">*</font> are mandatory</span>
            <table style='width: 360px'>
				<tr align="right">
					<td class='tCW'>Desired Username<font color="red">*</font>: </td>
					<td> <input style="margin-top: 3px;" type="text" name="username" size="30" maxlength="30" required /> </td>
				</tr>
				<tr align="right">
					<td class='tCW'>Password<font color="red">*</font>: </td>
					<td> <input style="margin-top: 3px;" type="password" name="password" size="30" maxlength="30" required /> </td>
				</tr>
				<tr align="right">
					<td class='tCW'>Confirm Password<font color="red">*</font>: </td>
					<td> <input style="margin-top: 3px;" type="password" name="password2" size="30" maxlength="30" required /> </td>
				</tr>
				<tr align="right">
					<td class='tCW'>Email<font color="red">*</font>: </td>
					<td> <input style="margin-top: 3px;" type="text" name="email" size="30" maxlength="30" required /> </td>
				</tr>
				<tr align="right">
					<td class='tCW'>Confirm Email<font color="red">*</font>: </td>
					<td> <input style="margin-top: 3px;" type="text" name="email2" size="30" maxlength="30" required /> </td>
				</tr>
				<tr align="right">
					<td class='tCW'>Name: </td>
					<td> <input style="margin-top: 3px;" type="text" name="name" size="30" maxlength="30" value="" /> </td>
				</tr>
				<tr align="right">
					<td class='tCW'>Surname: </td>
					<td> <input style="margin-top: 3px;" type="text" name="surname" size="30" maxlength="30" value="" /> </td>
				</tr>
				</table>

                <br />
                <label>Enter the contents of the image<font color="red">*</font></label>
                <br />
                <!--reCAPTHCA-->
                <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6Lcc58QSAAAAAN4tyQiyS6nqKyFUL2kk6qTUa5Qf"></script>
                <noscript>
                    <iframe src="http://www.google.com/recaptcha/api/noscript?k=6Lcc58QSAAAAAN4tyQiyS6nqKyFUL2kk6qTUa5Qf" height="300" width="500" frameborder="0"></iframe><br/>
                    <textarea name="recaptcha_challenge_field" rows="3" cols="40">
                    </textarea>
                    <input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
                </noscript>
                <!-- -->
                <input style="height: 25px; margin-top: 20px;" type="button" value="Register" onclick="validateFields()"/><br/>
        </fieldset>
        </form>
    </div>

<?php
require_once ('include/footer.php');
?>